package main

import "fmt"

// 不管什么牌子的车,都能跑

type car interface {
	run()
}

type falali struct {
	brand string
}
type baoshijie struct {
	brand string
}

func (f falali) run() {
	fmt.Printf("%s速度100km\n", f.brand)
}
func (b baoshijie) run() {
	fmt.Printf("%s速度120km\n", b.brand)
}

func drive(c car) {
	c.run()
}

func main() {
	var f1 = falali{
		"法拉利",
	}
	var b1 = baoshijie{
		"保时捷",
	}
	drive(f1)
	drive(b1)
}
